from django.urls import path
from . import views

urlpatterns = [
    # GET http://www.meiduo.site:8000/usernames/itcast/count/
    path('usernames/<username:username>/count/', views.UsernameCountView.as_view()),
    # GET http://www.meiduo.site:8000/mobiles/15962149852/count/
    path('mobiles/<mobile:phone_num>/count/', views.MobileCountView.as_view()),
    # POST http://www.meiduo.site:8000/register/
    path('register/', views.RegisterView.as_view()),
    # 现登录 POST  http://www.meiduo.site:8000/login/
    path('login/', views.LoginView.as_view()),
    # 退出登录 DELETE /logout/
    path('logout/', views.LogoutView.as_view()),
    # 用户中心 GET /info/
    path('info/', views.UserInfoView.as_view()),
    # 添加邮箱 PUT /emails/
    path('emails/', views.EmailView.as_view()),
    # 邮箱验证状态 PUT /emails/verification/
    path('emails/verification/', views.VerifyEmailView.as_view()),
    # POST /addresses/create/
    path('addresses/create/', views.CreateAddressView.as_view()),
    # 获取收货地址 GET /addresses/
    path('addresses/', views.AddressView.as_view()),
    # 修改收货地址PUT /addresses/(?P<address_id>\d+)/
    path('addresses/<int:address_id>/', views.UpdateDestroyAddressView.as_view()),
    # 设置默认地址 PUT /addresses/(?P<address_id>\d+)/default/
    path('addresses/<int:address_id>/default/', views.DefaultAddressView.as_view()),
    # 修改标题title PUT /addresses/(?P<address_id>\d+)/title/
    path('addresses/<int:address_id>/title/', views.UpdateTitleAddressView.as_view()),
    # 修改密码 PUT /password/
    path('password/', views.ChangePasswordView.as_view()),
]
